import { defHttp } from "@/utils/http";
// ERP 入库验收 VO
export interface WhsAcceptanceVO {
	checkId: string; // 验收单编号,示例值(2142)
	purOrderId: string; // 采购订单编号,示例值(19380)
	suplerId: string; // 供应商编号,示例值(24554)
	checkTime: Date; // 验收时间
	checkUserId: string; // 验收人员ID,示例值(14477)
	qualityUserId: string; // 质管员ID,示例值(17339)
	totalCount: number; // 合计数量,示例值(23489)
	qualifiedCount: number; // 合格数量,示例值(8995)
	unqualifiedCount: number; // 不合格数量,示例值(20837)
	checkResult: string; // 验收结果(1:合格 2:不合格 3:部分合格)
	fileUrl: string; // 附件地址,示例值(https://www.iocoder.cn)
	remark: string; // 备注,示例值(随便)
}

// ERP 入库验收 API
export const WhsAcceptanceApi = {
	// 查询入库验收分页
	getWhsAcceptancePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/gds-inspected/page`, params });
	},

	// 查询入库验收详情
	getWhsAcceptance: async (id: number) => {
		return await defHttp.get({ url: `/whs/gds-inspected/get?id=` + id });
	},

	// 新增入库验收
	createWhsAcceptance: async (data: WhsAcceptanceVO) => {
		return await defHttp.post({ url: `/whs/gds-inspected/create`, data });
	},

	// 修改入库验收
	updateWhsAcceptance: async (data: WhsAcceptanceVO) => {
		return await defHttp.put({ url: `/whs/gds-inspected/update`, data });
	},

	// 删除入库验收
	deleteWhsAcceptance: async (id: number) => {
		return await defHttp.delete({ url: `/whs/gds-inspected/delete?id=` + id });
	},

	// 导出入库验收 Excel
	exportWhsAcceptance: async (params: any) => {
		return await defHttp.download({ url: `/whs/gds-inspected/export-excel`, params });
	}
};
